package com.cyf.db.mapper;

import com.cyf.db.bean.OnlinePayUser;
import org.apache.ibatis.annotations.*;

/**
 * 激活在线支付的用户
 * Created by cage on 2017/2/18.
 */

public interface OnlinePayUserMapper {

    @Insert("insert into web_payuser(uuid, parkingId, name, cardNo, bankName, accountBankName, mobile, days, createdTime, status) values(" +
            "#{user.uuid}, #{user.parkingId}, #{user.name}, #{user.cardNo}, #{user.bankName}, #{user.accountBankName}, #{user.mobile}, " +
            "#{user.days}, #{user.createdTime}, 0)")
    @SelectKey(statement = "select LAST_INSERT_ID()", keyProperty = "user.id", before = false, resultType = int.class)
    void insertOnlinePayUser(@Param("user") OnlinePayUser onlinePayUser);

    @Select("select * from web_payuser where parkingId = #{parkingId}")
    OnlinePayUser getByParkingId(@Param("parkingId") int parkingId);
}
